<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" th:href="@{/css/reset.css}" type="text/css"/>
    <link rel="stylesheet" th:href="@{/css/main.css}" type="text/css"/>
    <script th:src="@{/js/jquery-1.12.4.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/jquery-ui.min.js}" type="text/javascript"></script>
</head>
<body>
<div th:fragment="carCount">
    <div class="guest_cart fr">
        <a class="cart_name fl" th:href="@{/user/car/list}">我的购物车</a>
        <div class="goods_count fl" id="show_count">0</div>
    </div>
    <script>
        $(function () {
            $.ajax({
                url: "/user/car/countCar",
                type: "get",
                dataType: "json",
                success: function (res) {
                    if (res.code == 200) {
                        console.log(res.data.count);
                        document.getElementById("show_count").innerText = res.data.count;
                        console.log($('#carCount').val());
                        return;
                    }
                }
            })
        })
    </script>
</div>

</body>
</html>